Skip to content

Backports some patches to Python 2.7 branch#339

Merged
HorlogeSkynet merged 14 commits intopython2.7-supportfrom
backports/sep2021-may2022
Jun 21, 2022
Merged

Backports some patches to Python 2.7 branch#339
HorlogeSkynet merged 14 commits intopython2.7-supportfrom
backports/sep2021-may2022

Conversation

@HorlogeSkynet
Copy link
Copy Markdown
Member

@HorlogeSkynet HorlogeSkynet commented Jun 7, 2022

PS : I had to adapt #331 due Python 2.7 support drop by upstream black and underlying click dependency...

HorlogeSkynet and others added 14 commits June 7, 2022 21:07
... and remove `amazon` from "missing distributions" test cases list

> closes #252
This allows executing the file as a standalone script.

Previously, without the shebang, trying to execute results in the
following:

    $ ./distro.py
    ./distro.py: line 28: platform.linux_distribution: command not found
    ./distro.py: line 28: platform.dist: command not found
    ./distro.py: line 28: Python: command not found
    ./distro.py: command substitution: line 29: syntax error near unexpected token `newline'
    ./distro.py: command substitution: line 29: `<https://bugs.python.org/issue1322>'
    ...

Now:

    $ ./distro.py
    Name: Fedora 34 (Workstation Edition)
    Version: 34
    Codename:
distro#230 introduced proper support for os-release `VERSION_CODENAME`
attribute but broke compatibility shim with (now defunct)
`platform.linux_distribution` as the third tuple member (codename) were
not taken from `VERSION` os-release attribute anymore.

Closes #238.
`subprocess.CalledProcessError` exceptions are now caught since 9260b7b
Copy link
Copy Markdown
Collaborator

@nir0s nir0s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. I admit that I'm not following up on each and every change, though.

@HorlogeSkynet
Copy link
Copy Markdown
Member Author

Overall LGTM. I admit that I'm not following up on each and every change, though.

I've "only" cherry-picked commits that could easily be applied, the other ones are left for those who would need them.
Thanks for reviewing this 🙇

@HorlogeSkynet HorlogeSkynet merged commit 2808f6b into python2.7-support Jun 21, 2022
@HorlogeSkynet HorlogeSkynet deleted the backports/sep2021-may2022 branch June 21, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants